from langchain.prompts import PromptTemplate

# Prompt 模板封装
template = PromptTemplate.from_template("给我讲一个关于{subject}的故事")

print(template)

print(template.format(subject="小白兔"))

from langchain_deepseek import ChatDeepSeek

# 定义llm
llm = ChatDeepSeek(model="deepseek-reasoner")

# 通过 Prompt 调用 LLM
ret = llm.invoke(template.format(subject="小白兔"))

print(ret.content)